#ifndef ORDERFORM_H
#define ORDERFORM_H

#include <QtGui/QWidget>
#include <qfile.h>
#include <QDomDocument>
#include <QTextStream>
#include <QTextCodec>
#include <QSpinBox>
#include <QDir>
#include <QMessageBox>
#include <QSortFilterProxyModel>
#include "runtab.h"
#include "ui_orderform.h"
#include "order.h"

struct Impos
{
	int count;
	int width;
	int height;
	int num_x;
	int num_y;
	StartPoint point;
	QList<StartPoint> next_points; 
};

class OrderForm : public QWidget
{
    Q_OBJECT

public:
    OrderForm(QWidget *parent = 0);
    ~OrderForm();
    
    COrder GetOrder();
    void SetOrder(COrder&);
    
    QString GetNumber();
    /*QString GetCustName();
    QString GetOrderName();
    QString GetCustAddress();
    
    QString GetPaperName();
    QString GetPaperDen();
    QString GetPaperPressSheet();
    QString GetPaperSize();
    QString GetPaperCut();
    QString GetPaperRun();
    QString GetPaperWaste();
    QString GetFaceColor();
    QString GetBackColor();
    QString GetPrinterName();
    QString GetPrintNote();*/ 
    
public slots:
    void AddNewProduct();
    void DelCurProduct();
    void SetPaper();
    void SetFormat();
    void SetCustomerAddress(int); 
    void SetMemoris();
    void SetPrinter(); 
    void AddRunTab();
    void RemoveRunTab();
    void OpenRunTab(int);
    
    bool generateRun();

public:
	QSortFilterProxyModel *custProxyModel;
    Ui::OrderFormClass ui;
    QString state; 
    QList<Group> groups;
};

#endif // ORDERFORM_H
